package buildernodirector;

/**
 * @author 赵希奥
 * @date 2022/3/17 1:06
 * @gitHub https://github.com/CKXGZXA
 * @gitee https://gitee.com/ckxgzxa
 * @description: 客户端测试类
 */
public class Client {
    public static void main(String[] args) {
        // 针对抽象建造者编程
        CarBuilder cb;
        // 反射生成具体建造者对象
        cb = (CarBuilder) XMLUtil.getBean();

        Car car;
        assert cb != null;
        car = CarBuilder.construct(cb);

        System.out.println("宝马汽车:");
        System.out.println("轮胎: " + car.getTire());
        System.out.println("发动机: " + car.getEngine());
        System.out.println("方向盘: " + car.getSteeringWheel());
    }

}
